//公告管理//query
Jes.Notice ={
	init : function(){
		if(!Jes.userSess()) return;
		Jes.cBtn('../../jesacl/html/welcome.html');
		Jes("search").onclick=function(){Jes.Notice.query();}
		Jes("add").onclick=function(){Jes.Notice.open('op');}
		Jes("del").onclick=function(){Jes.Notice.del('del');}
		initTabs('tabView_1',Array('公告查询'),0,"100%",90,Array(false));
		this.query();
	}
	,query : function(){
		Jes.page("notice_query_sql@bs",{pageSize:10});
	}
	,del : function(){
		var ids = Jes.val("id");
		if(ids == ""){alert("至少选择一项!");return;}
		if(!confirm("你确定删除商机吗？")) return;
		Jes.sql({ids:ids,sql:"notice_delete_hql@bs"});
	}
	,open : function(type,id){
		var args= arguments;
		switch(type){
			case "op":
					//Jes.open("../../oppor/html/opporop.html"+(id?"?id="+id:""),300,300);
					//Jes.Dialog.open("商机编辑","../../oppor/html/opporop.html"+(id?"?id="+id:""),300,300);
					//top.Jes.Dialog.open("商机编辑","../../oppor/html/opporop.html"+(id?"?id="+id:""),500,500);
					_newTab(id?'公告编辑':'公告新增',"noticeop.html".J({id:id}));
				break;
		}
	}
}

//op
Jes.NoticeOp = {
	init : function(){
		if(!Jes.userSess()) return;
		var id = Jes.request("id");
		Jes("add").onclick=function(){Jes.NoticeOp.save();}//save
		Jes.cBtn('notice.html');
		Jes.fck("content","680","250","Basic");
		if(id){
			Jes.html('op_title','公告编辑');
			Jes.queryO("TJesNotice",{param:{id:id}});
		}
	}
	,save : function(){
		Jes.save("TJesNotice");
	}
}

//友情链接管理//query
Jes.Link ={
	init : function(){
		if(!Jes.userSess()) return;
		Jes.cBtn('../../jesacl/html/welcome.html');
		Jes('search').onclick=function(){Jes.Link.query();}
		Jes('add').onclick=function(){Jes.Link.open('op');}
		Jes('del').onclick=function(){Jes.Link.del('del');}
		initTabs('tabView_1',Array('友情链接查询'),0,"100%",90,Array(false));
		Jes.sync(function(){
			Jes.Select.link(false);
		});
		this.query();
	}
	,query : function(){
		Jes.page("link_query_sql@bs",{pageSize:10});
	}
	,del : function(){
		var ids = Jes.val("id");
		if(ids == ""){alert("至少选择一项!");return;}
		if(!confirm("你确定删除友情链接吗？")) return;
		Jes.sql({ids:ids,sql:"link_delete_hql@bs"});
	}
	,open : function(type,id){
		var args= arguments;
		switch(type){
			case "op":
					_newTab(id?'友情链接编辑':'友情链接新增',"linkop.html".J({id:id,type:Jes('type').value}));
				break;
		}
	}
}

//op
Jes.LinkOp = {
	init : function(){
		if(!Jes.userSess()) return;
		var req = Jes.request();
		Jes("add").onclick=function(){Jes.LinkOp.save();}//save
		Jes.cBtn('notice.html');
		Jes.sync(function(){
			Jes.Select.link();
			Jes.val('type',req.type);
		});
		if(req.id){
			Jes.html('op_title','友情链接编辑');
			Jes.queryO('TJesLink',{param:{id:req.id}},function(da){
				if(da.islogo=='1'){
					Jes.show('uplogo');
					Jes.Upload.showImg('ta_query1_pic',da.logo);//
				}
				Jes.vals(da);
			});
		}
	}
	,save : function(){
		Jes.save("TJesLink");
	}
}


//视频管理//query
Jes.Video ={
	init : function(){
		if(!Jes.userSess()) return;
		Jes.cBtn('../../jesacl/html/welcome.html');
		Jes("search").onclick=function(){Jes.Video.query();}
		Jes("add").onclick=function(){Jes.Video.open('op');}
		Jes("del").onclick=function(){Jes.Video.del('del');}
		initTabs('tabView_1',Array('视频管理查询'),0,"100%",90,Array(false));
		Jes.Select.video();
		this.query();
	}
	,query : function(){
		Jes.page("video_query_sql@bs",{pageSize:10});
	}
	,del : function(){
		var ids = Jes.val("id");
		if(ids == ""){alert("至少选择一项!");return;}
		if(!confirm("你确定删除友情链接吗？")) return;
		Jes.sql({ids:ids,sql:"video_delete_hql@bs"});
	}
	,open : function(type,id){
		var args= arguments;
		switch(type){
			case "op":
					_newTab(id?'视频管理编辑':'视频管理新增',"videoop.html".J({id:id}));
				break;
		}
	}
}

//op
Jes.VideoOp = {
	init : function(){
		if(!Jes.userSess()) return;
		var id = Jes.request("id");
		Jes("add").onclick=function(){Jes.VideoOp.save();}//save
		Jes.cBtn('notice.html');
		Jes.Select.video();
		if(id){
			Jes.html('op_title','视频管理编辑');
			Jes.queryO('TJesVideo',{param:{id:id}});
		}
	}
	,save : function(){
		Jes.save("TJesVideo");
	}
}

//友情链接管理//query
Jes.Ask ={
	init : function(){
		if(!Jes.userSess()) return;
		Jes.cBtn('../../jesacl/html/welcome.html');
		Jes("search").onclick=function(){Jes.Ask.query();}
		//Jes("add").onclick=function(){Jes.Ask.open('op');}
		Jes.hide('add');
		Jes("del").onclick=function(){Jes.Ask.del('del');}
		initTabs('tabView_1',Array('公众互动查询'),0,"100%",90,Array(false));
		Jes.sync(function(){
			Jes.Select.ask(1);
		});
		var type = Jes.request('type');
		Jes.val('type',type);
		this.query();
	}
	,query : function(){
		Jes.page("ask_query_sql@bs",{pageSize:10});
	}
	,del : function(){
		var ids = Jes.val("id");
		if(ids == ""){alert("至少选择一项!");return;}
		if(!confirm("你确定删除在线投诉吗？")) return;
		Jes.sql({ids:ids,sql:"ask_delete_hql@bs"});
	}
	,open : function(type,id){
		var args= arguments;
		switch(type){
			case "op":
					_newTab(id?'公众互动编辑':'公众互动新增',"askop.html".J({id:id}));
				break;
		}
	}
}

//op
Jes.AskOp = {
	init : function(){
		if(!Jes.userSess()) return;
		Jes.Upload.clear();
		Jes.read('type','name','pwd','email','tel','address','title','content','ispub');
		var id = Jes.request("id");
		Jes('add').onclick=function(){Jes.AskOp.save();}//save
		Jes.cBtn('ask.html');
		Jes.sync(function(){
			Jes.Select.ask();
		});
		if(id){
			Jes.html('op_title','公众互动编辑');
			Jes.queryO('TJesAsk',{param:{id:id}},function(da){
				Jes.vals(da);
				Jes.vals(da,'info');
			});
		}
		Jes.Upload.query({param:{bussid:id,busstype:5}});
	}
	,save : function(){
		Jes.save("TJesAsk");
	}
}


Jes.Topcss ={
	init : function(){
		if(!Jes.userSess()) return;
		Jes.cBtn('../../jesacl/html/welcome.html');
		Jes("search").onclick=function(){Jes.Topcss.query();}
		Jes("add").onclick=function(){Jes.Topcss.open('op');}
		Jes("del").onclick=function(){Jes.Topcss.del('del');}
		initTabs('tabView_1',Array('主贴样式查询'),0,"100%",90,Array(false));
		this.query();
	}
	,query : function(){
		Jes.page("topcss_query_sql@bs",{pageSize:10});
	}
	,del : function(){
		var ids = Jes.val("id");
		if(ids == ""){alert("至少选择一项!");return;}
		if(!confirm("你确定删除主贴样式吗？")) return;
		Jes.sql({ids:ids,sql:"topcss_delete_hql@bs"});
	}
	,open : function(type,id){
		var args= arguments;
		switch(type){
			case "op":
					_newTab(id?'主贴样式编辑':'主贴样式新增',"topcssop.html".J({id:id}));
				break;
		}
	}
}

//op
Jes.TopcssOp = {
	init : function(){
		if(!Jes.userSess()) return;
		var id = Jes.request("id");
		Jes("add").onclick=function(){Jes.TopcssOp.save();}//save
		Jes.cBtn('topcss.html');
		if(id){
			Jes.html('op_title','主贴样式编辑');
			Jes.queryO('TJesTopcss',{param:{id:id}});
		}
	}
	,save : function(){
		Jes.save("TJesTopcss");
	}
}
//对联
Jes.Couplet ={
	init : function(){
		if(!Jes.userSess()) return;
		Jes.cBtn('../../jesacl/html/welcome.html');
		Jes("search").onclick=function(){Jes.Couplet.query();}
		Jes("add").onclick=function(){Jes.Couplet.open('op');}
		Jes("del").onclick=function(){Jes.Couplet.del('del');}
		initTabs('tabView_1',Array('对联查询'),0,"100%",90,Array(false));
		this.query();
	}
	,query : function(){
		Jes.page("couplet_query_sql@bs",{pageSize:10});
	}
	,del : function(){
		var ids = Jes.val("id");
		if(ids == ""){alert("至少选择一项!");return;}
		if(!confirm("你确定删除对联吗？")) return;
		Jes.sql({ids:ids,sql:"couplet_delete_hql@bs"});
	}
	,open : function(type,id){
		var args= arguments;
		switch(type){
			case "op":
					_newTab(id?'对联编辑':'对联新增',"coupletop.html".J({id:id}));
				break;
		}
	}
}

//op
Jes.CoupletOp = {
	init : function(){
		if(!Jes.userSess()) return;
		var id = Jes.request("id");
		Jes('add').onclick=function(){Jes.CoupletOp.save();}//save
		Jes.cBtn('couplet.html');
		if(id){
			Jes.html('op_title','对联编辑');
			Jes.queryO('TJesCouplet',{param:{id:id}},function(da){
				Jes.vals(da);;
				Jes.Upload.showImg('ta_query1_pic',da.leftimg);//
				Jes.Upload.showImg('ta_query2_pic',da.rightimg);//
			});
		}
	}
	,save : function(){
		Jes.save("TJesCouplet");
	}
}

//漂浮图片
Jes.Flowimg ={
	init : function(){
		if(!Jes.userSess()) return;
		Jes.cBtn('../../jesacl/html/welcome.html');
		Jes("search").onclick=function(){Jes.Flowimg.query();}
		Jes("add").onclick=function(){Jes.Flowimg.open('op');}
		Jes("del").onclick=function(){Jes.Flowimg.del('del');}
		initTabs('tabView_1',Array('漂浮图片查询'),0,"100%",90,Array(false));
		this.query();
	}
	,query : function(){
		Jes.page("flowimg_query_sql@bs",{pageSize:10});
	}
	,del : function(){
		var ids = Jes.val("id");
		if(ids == ""){alert("至少选择一项!");return;}
		if(!confirm("你确定删除漂浮图片吗？")) return;
		Jes.sql({ids:ids,sql:"flowimg_delete_hql@bs"});//bug
	}
	,open : function(type,id){
		var args= arguments;
		switch(type){
			case "op":
					_newTab(id?'漂浮图片编辑':'漂浮图片新增',"flowimgop.html".J({id:id}));
				break;
		}
	}
}

//op
Jes.FlowimgOp = {
	init : function(){
		if(!Jes.userSess()) return;
		var id = Jes.request("id");
		Jes('add').onclick=function(){Jes.FlowimgOp.save();}//save
		Jes.cBtn('flowimg.html');
		if(id){
			Jes.html('op_title','漂浮图片编辑');
			Jes.queryO('TJesFlowimg',{param:{id:id}},function(da){
				Jes.vals(da);;
				Jes.Upload.showImg('ta_query1_pic',da.img);//
			});
		}
	}
	,save : function(){
		Jes.save("TJesFlowimg");
	}
}